package com.books4sale.admin.dto;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;


import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.users.User;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
public class Book {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key id;
	
	private User owner;
	
	private Date date;
	
	private String bookName;
	
	private String bookCollage;
	
	private String bookSubject;
	
	private String bookPrice;

	@Persistent
	private Profile profile;

	public Book() {
	}
	public Book(User owner, Date date, String bookName, String bookCollage,
			String bookSubject, String bookPrice) {
		super();
		this.owner = owner;
		this.date = date;
		this.bookName = bookName;
		this.bookCollage = bookCollage;
		this.bookSubject = bookSubject;
		this.bookPrice = bookPrice;
	}
	
	public Key getId() {
		return id;
	}
	public User getOwner() {
		return owner;
	}

	public Date getDate() {
		return date;
	}

	public String getBookName() {
		return bookName;
	}

	public String getBookCollage() {
		return bookCollage;
	}

	public String getBookSubject() {
		return bookSubject;
	}

	public String getBookPrice() {
		return bookPrice;
	}
	
	public void setId(Key id){
		this.id = id;
	}

	public void setOwner(User owner) {
		this.owner = owner;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public void setBookName(String bookName) {
		this.bookName = bookName;
	}

	public void setBookCollage(String bookCollage) {
		this.bookCollage = bookCollage;
	}

	public void setBookSubject(String bookSubject) {
		this.bookSubject = bookSubject;
	}

	public void setBookPrice(String bookPrice) {
		this.bookPrice = bookPrice;
	}
	
	@Override
	public String toString() {
		return id.toString() + " / " + bookName  + " / " + bookCollage ;
	}
	public Profile getProfile() {
		return profile;
	}
	public void setProfile(Profile profile) {
		this.profile = profile;
	}

}
